#ifndef _SELECTOR_H_
#define _SELECTOR_H_
#include "ValidatorBase.h"
#include "MgrBase.h"
#include "SimpleRefection.h"

struct EventArgBase;
class CombatObj;
class SelectRule;
class Selector:public ReflectionBase
{
	DECL_REFLECTION(Selector,"../../config/Selector.xml");
public:
	void SelectTargets(EventArgBase& rEventArg,std::vector<CombatObj*>& vTargets) const ;

	int32				m_iID;
	std::string m_sDisplayName;
	ESelectRange	m_eSelectRange;
	int32				m_iVOne;
	int32				m_iVEach;
	int32				m_iRule;
	ECombatSide			m_bAppendHero;
	rewrite virtual void OnArchieveReaded();
private:
	void RangeSelect(const EventArgBase& rEventArg,std::vector<CombatObj*>& vTargets) const;
	void FilterObjects(std::vector<CombatObj*>& vTargets) const;
	void FilterEachObjects(CombatObj* pOwner,std::vector<CombatObj*>& vTargets) const;
	void SelectByRule(std::vector<CombatObj*>& vTargets)const ;
	const TObjValidators* m_pObjValidators;
	const TEachValidators* m_pEachValidators;
	const SelectRule* m_pSelectRule;
	

};
typedef DefMangerTpl<Selector> SelectorManager;

#endif